// my.js
Page({
  data: {
    navHeight: 132,
    sectionTop: 132,
    user: {
      nickname: '刻苦~owo',
      avatar: '/images/我的.png'
    },
    primaryMenus: [
      { key: 'trip', title: '我的行程', icon: '🧳' },
      { key: 'profile', title: '个人信息', icon: '👤' },
      // { key: 'follow', title: '我的关注', icon: '💗' },
      // { key: 'coupon', title: '兑换优惠', icon: '🎁' }
    ],
    secondaryMenus: [
      { key: 'service', title: '联系客服', icon: '🎧', meta: '4000081223' },
      // { key: 'weibo', title: '官方微博', icon: '👻', meta: '@走之旅行' }
    ]
  },

  onNavHeightChange(e) {
    const { totalHeight } = e.detail || {}
    if (totalHeight) this.setData({ navHeight: totalHeight, sectionTop: totalHeight + 24 })
  },

  onMenuTap(e) {
    const { key } = e.currentTarget.dataset
    switch (key) {
      case 'service':
        wx.makePhoneCall({ phoneNumber: '4000081223', fail: () => wx.setClipboardData({ data: '4000081223' }) })
        break
      default:
        wx.showToast({ title: '功能开发中', icon: 'none' })
    }
  }
})

